<?php
/*
 * @Author: lokei
 * @Date: 2022-09-18 13:16:51
 * @LastEditors: lokei
 * @LastEditTime: 2022-09-18 17:49:40
 * @Description: 
 */
namespace App\Http\Controllers\Store\Tag;

use App\Common\Tools\ResultTool;
use App\Http\Controllers\Controller;
use App\Models\Store\StoreModel;
use Illuminate\Http\Request;

class TagController extends Controller {
    public function ofStore(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('id'))->first();
        $res = ResultTool::success();
        $res['data']['tags'] = $store->tags;
        return $res;
    }

    public function set(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('id'))->first();
        $store->tags = $request->input('tags');
        $store->save();
        return ResultTool::success();
    }
}